<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>后盾人</title>
  </head>
  <body></body>
  <script>
    class Cache {
      static data = {};
      static set(name, value) {
        return (this.data[name] = value);
      }
      static get(name) {
        return this.data[name];
      }
    }
    // Cache.set("hdcms", "houdunren.com");
    // console.log(Cache.get("hdcms"));
    let user = {
      name: "apple",
      desc: "用户资料",
      key: Symbol("资料")
    };
    let cart = {
      name: "apple",
      desc: "购物车",
      key: Symbol("资料")
    };
    Cache.set(user.key, user);
    Cache.set(cart.key, cart);
    console.log(Cache.get(cart.key));
  </script>
</html>
